﻿@using DreamStore.WebShop.Models

@{
    var orders = (IList<OrderRecord>) Model.Orders;
    Layout.Title = T("All Orders");
}

<table class="items" summary="@T("This is a table of the orders of the current customer in your application")">
        <colgroup>
            <col id="Col1" />
            <col id="Col2" />
            <col id="Col3" />
            <col id="Col4" />
            <col id="Col5" />
            <col id="Col6" />
            <col id="Col7" />
        </colgroup>
        <thead>
            <tr>
                <th scope="col">&nbsp;&darr;</th>
                <th scope="col">@T("Number")</th>
                <th scope="col">@T("Status")</th>
                <th scope="col">@T("CustomerId")</th>
                <th scope="col">@T("Total")</th>
                <th scope="col">@T("Created")</th>
                <th scope="col">@T("Paid")</th>
                <th scope="col">@T("Actions")</th>
            </tr>
        </thead>
        @foreach (var order in orders) {
        <tr>
            <td>@order.Id</td>
            <td>@order.Number</td>
            <td>@order.Status</td>
            <td><a href="@Url.Action("ListOrders", "CustomerAdmin", new { id = order.CustomerId })">@order.CustomerId</a></td>
            <td>@order.Total</td>
            <td>@order.CreatedAt</td>
            <td>@order.PaidAt</td>
            <td>
                <div>
                    <a href="@Url.Action("Edit", "OrderAdmin", new {order.Id, returnUrl = Request.Url.PathAndQuery})" title="@T("Edit")">@T("Edit")</a>
                </div>
            </td>
        </tr>
        } 
    </table>